import request from '@/utils/requestHall';

export function treeMenu(query) {
  return request({
    // url: '/api/system/menu/treeMenu',
    url: `/sociaty/list${query}`,
    method: 'get'
  })
}

export function saveMenu(form) {
  return request({
    url: '/sociaty/add',
    method: 'post',
    data: form
  })
}

export function updateMenu(form) {
  return request({
    url: '/menu/update',
    method: 'post',
    data: form
  })
}
export function cacheMenu() {
  return request({
    url: '/menu/cache',
    method: 'get',
  })
}
export function getDetail(id) {
  return request({
    url: `/sociaty/detail?sociaty_id=${id}`,
    method: 'get',
  })
}

export function deleteMenu(id) {
  return request({
    url: '/api/system/menu/delete',
    method: 'post',
    data: { 'id': id }
  });
}


export function getSysPermissionPage(query) {
  return request({
    url: '/api/system/menu/listPage',
    method: 'post',
    data: query
  });
}

export function setToplimit(query) {
  return request({
    url: '/sociaty/update/toplimit',
    method: 'post',
    data: query
  });
}

export function getSysPermissionById(id) {
  return request({
    url: '/api/system/menu/getById',
    method: 'post',
    data: { 'id': id }
  });
}

export function dismiss(query) {
  return request({
    url: '/sociaty/dismiss',
    method: 'post',
    data: query
  });
}
